<!DOCTYPE html>
<html>
  <head>
    <title></title>
    <link rel='stylesheet' href='/css/bootstrap.css' />
  </head>
  <body>
    <div class="container">
      <div class="row">
        <div class="col-xs-12 col-md-8 col-md-offset-2 col-lg-4 col-lg-offset-4">
          <h2>登录</h2>
          <hr/>
          <form action="/login" method="post">
            <div class="form-group">
              <label for="item">用户名</label>
              <input name="username" type="text" class="form-control" id="item">
            </div>
            <div class="form-group">
              <label for="item">密码</label>
              <input name="password" type="text" class="form-control" id="item">
            </div>
            <hr/>
            <button type="submit" class="btn btn-primary btn-block">登录</button>
          </form>
        </div>
      </div>
    </div>
  </body>
  <script>
    //获取所有delBtn
    let delBtn = document.querySelectorAll('.delBtn');
    //绑定事件
    delBtn.forEach(item=>{
      item.addEventListener('click',function(e){
        if(confirm('您确定要删除吗？')){
          return true;//如果点击是直接放行
        }else{
          //阻止默认行为
          e.preventDefault();
        }
      })
    })
  </script>
</html>
